package com.zhentao.controller;

import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.model.pay.pojo.ApUserMembership;
import com.zhentao.model.pay.vo.BalanceVo;
import com.zhentao.service.ApUserMembershipService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("api/v1/admin/pay/card")
@Api(tags = "PayCardController-用户支付会员管理")
public class PayCardController {
    @Resource
    ApUserMembershipService apUserMembershipService;

    /**
     * 用户充值添加
     * @param userMembership
     * @return
     */
    @PostMapping("/add")
    @ApiOperation("用户充值添加")
    public ResponseResult add(@RequestBody ApUserMembership userMembership){
        return apUserMembershipService.add(userMembership);
    }

    /**
     * 用户提现
     * @param balanceVo
     * @return
     */
    @PostMapping("/outMoney")
    @ApiOperation("用户提现")
    public ResponseResult outMoney(@RequestBody BalanceVo balanceVo){
        return apUserMembershipService.outMoney(balanceVo);
    }


//    @ApiOperation("根据userid查看提现失败原因")
//    @GetMapping("/getFeedback/{userId}")
//    public ResponseResult getFeedback(@PathVariable("userId") Integer userId){
//        return apUserMembershipService.getFeedback(userId);
//    }
}
